package com.ssm.controller.admin;

import com.ssm.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
public class AdminDashboardController extends BaseController {
    //转到仪表盘页面
    @RequestMapping(value = "admin/dashboard",method = RequestMethod.GET)
    public String goToPage (HttpSession session, Map<String,Object> map){
        logger.info("检查管理员权限");
        String adminId=checkAdmin(session);
        if (!adminId.equals("adminId")){
            return "redirect:/";
        }
        return "admin/dashboard";
    }
}
